/**
 * <pre>
 * Title: 		PortFactory.java
 * Author:		linriqing
 * Create:	 	2010-7-15 上午11:15:19
 * Copyright: 	Copyright (c) 2010
 * Company:		Shenzhen Helper
 * <pre>
 */
package com.hengpeng.itfints.port;

import com.hengpeng.common.persist.QueryParameter;
import com.hengpeng.common.persist.QueryResult;
import com.hengpeng.common.persist.entity.AbstractEntity;
import com.hengpeng.common.persist.query.DynamicQuery;
import com.hengpeng.itfinbase.message.ResponseMessage;
import com.hengpeng.itfinbase.message.TransMessage;

/**
 * <pre>
 * 远程接口工厂
 * </pre>
 * @author linriqing
 * @version 1.0, 2012-5-21
 */
public interface PortFactory
{
	/**
	 * <pre>
	 * 调用远程交易接口
	 * </pre>
	 * @param transMessage 请求消息
	 * @return 响应消息
	 */
	public ResponseMessage remoteTrans(TransMessage transMessage);

	public <T extends ResponseMessage> T remoteTrans(TransMessage transMessage, Class<T> clz);

	/**
	 * <pre>
	 * 调用远程查询接口
	 * </pre>
	 * @param <T> 范型类型
	 * @param queryParameters 查询参数
	 * @return 返回查询结果
	 */
	public <T extends AbstractEntity> QueryResult<T> remoteQuery(QueryParameter<T> queryParameters);

	public <T extends AbstractEntity> QueryResult<T> remoteQuery(DynamicQuery query, Class<T> clz);
}
